package me.atbar.moonlib.area.type;

import lombok.Getter;
import me.atbar.moonlib.area.BaseArea;
import org.bukkit.Location;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import java.util.Map;

/**
 * @author Administrator
 */
public class CommonArea extends BaseArea implements ConfigurationSerializable {

    @Getter
    private final Location min;
    @Getter
    private final Location max;

    private CommonArea(CommonBuilder builder) {
        super(builder);
        min = builder.min;
        max = builder.max;
    }

    @Override
    public Map<String, Object> serialize() {
        return null;
    }

    public static class CommonBuilder extends BaseBuilder<CommonBuilder> {

        @Getter
        private final Location min;
        @Getter
        private final Location max;

        public CommonBuilder(Location min, Location max) {
            super(min, max);
            this.min = super.getMin();
            this.max = super.getMax();
        }

        @Override
        public CommonArea build() {
            return new CommonArea(this);
        }

        @Override
        protected CommonBuilder self() {
            return this;
        }
    }

}
